const KimCache = {

  getLocalStorage(secondLevelDist, secondLevelParams) {
    try {
      return JSON.parse(localStorage[secondLevelDist])[secondLevelParams]
    } catch (e) {
      console.warn("获取缓存错误")
      return ""
    }
  },


  setLocalStorage(secondLevelDist, secondLevelName, secondLevelParams) {
    try {
      let obj = localStorage[secondLevelDist] ? JSON.parse(localStorage[secondLevelDist]) : {}
      obj[secondLevelName] = secondLevelParams;
      return localStorage[secondLevelDist] = JSON.stringify(obj)
    } catch (e) {
      console.warn("设置缓存错误")
      return "设置缓存错误"
    }
  }


}

export {KimCache}
